var htmlContent = String.Format("<body>Hello world: {0}</body>", DateTime.Now); var pdfBytes = (new NReco.PdfGenerator.HtmlToPdfConverter()).GeneratePdf(htmlContent); //https://www.nrecosite.com/doc/NReco.PdfGenerator/